<?php
class category extends database{
	protected $_table = "tbl_category";
	protected $_product = "tbl_products";
	public function listcate(){
		$sql = "select * from $this->_table";
		$this->query($sql);
		return $this->fetchall();
	}
	public function getdata($id){
		$sql = "select * from $this->_table where cate_id = '$id'";
		$this->query($sql);
		return $this->fetch();
	}
	public function listproduct($cateid){
		$sql = "select * from $this->_product where cate_id = '$cateid'";
		$this->query($sql);
		return $this->fetchall();
	}
}